package jg.simkit.core.exception;

/**
 * 带有状态码的异常
 * @author gaolj
 */
public class StatefulException extends RuntimeException {

    private int status;

    public StatefulException() {
        super();
    }

    public StatefulException(String message) {
        super(message);
    }

    public StatefulException(String message, Throwable cause) {
        super(message, cause);
    }

    public StatefulException(Throwable cause) {
        super(cause);
    }

    protected StatefulException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public StatefulException(int status, String message) {
        super(message);
        this.status = status;
    }

    public StatefulException(int status, String message, Throwable cause) {
        super(message, cause);
        this.status = status;
    }

    public StatefulException(int status, Throwable cause) {
        super(cause);
        this.status = status;
    }

    protected StatefulException(int status, String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.status = status;
    }

    /**
     * @return 获取异常状态码
     */
    public int getStatus() {
        return status;
    }

}
